package com.ruoyi.picking_detail.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.picking_detail.mapper.ErpMaterialIssueDetailMapper;
import com.ruoyi.picking_detail.domain.ErpMaterialIssueDetail;
import com.ruoyi.picking_detail.service.IErpMaterialIssueDetailService;

/**
 * 生产领料子Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-18
 */
@Service
public class ErpMaterialIssueDetailServiceImpl implements IErpMaterialIssueDetailService 
{
    @Autowired
    private ErpMaterialIssueDetailMapper erpMaterialIssueDetailMapper;

    /**
     * 查询生产领料子
     * 
     * @param id 生产领料子主键
     * @return 生产领料子
     */
    @Override
    public ErpMaterialIssueDetail selectErpMaterialIssueDetailById(Long id)
    {
        return erpMaterialIssueDetailMapper.selectErpMaterialIssueDetailById(id);
    }

    /**
     * 查询生产领料子列表
     * 
     * @param erpMaterialIssueDetail 生产领料子
     * @return 生产领料子
     */
    @Override
    public List<ErpMaterialIssueDetail> selectErpMaterialIssueDetailList(ErpMaterialIssueDetail erpMaterialIssueDetail)
    {
        return erpMaterialIssueDetailMapper.selectErpMaterialIssueDetailList(erpMaterialIssueDetail);
    }

    /**
     * 新增生产领料子
     * 
     * @param erpMaterialIssueDetail 生产领料子
     * @return 结果
     */
    @Override
    public int insertErpMaterialIssueDetail(ErpMaterialIssueDetail erpMaterialIssueDetail)
    {
        erpMaterialIssueDetail.setCreateTime(DateUtils.getNowDate());
        return erpMaterialIssueDetailMapper.insertErpMaterialIssueDetail(erpMaterialIssueDetail);
    }

    /**
     * 修改生产领料子
     * 
     * @param erpMaterialIssueDetail 生产领料子
     * @return 结果
     */
    @Override
    public int updateErpMaterialIssueDetail(ErpMaterialIssueDetail erpMaterialIssueDetail)
    {
        erpMaterialIssueDetail.setUpdateTime(DateUtils.getNowDate());
        return erpMaterialIssueDetailMapper.updateErpMaterialIssueDetail(erpMaterialIssueDetail);
    }

    /**
     * 批量删除生产领料子
     * 
     * @param ids 需要删除的生产领料子主键
     * @return 结果
     */
    @Override
    public int deleteErpMaterialIssueDetailByIds(Long[] ids)
    {
        return erpMaterialIssueDetailMapper.deleteErpMaterialIssueDetailByIds(ids);
    }

    /**
     * 删除生产领料子信息
     * 
     * @param id 生产领料子主键
     * @return 结果
     */
    @Override
    public int deleteErpMaterialIssueDetailById(Long id)
    {
        return erpMaterialIssueDetailMapper.deleteErpMaterialIssueDetailById(id);
    }
}
